home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 4 / MacMania 4.toast / / Internet software / Traceroute 1.1 / TR Enet LAP 1.2 Release Notes next >
Text File  |  1996-03-10  |  8KB  |  131 lines

  1. Traceroute Ethernet LAP 1.2
  2. By: Jim Browne (jbrowne@jbrowne.com)
  3. March 9th, 1996
  4.  
  5. Contents:
  6.          • Introduction
  7.          • What does it do?
  8.          • Any known bugs?
  9.          • The Gestalt selector
  10.          • How to send Raw IP packets
  11.          • How to filter incoming IP packets
  12.          • So where's Traceroute?
  13.          • What about source code?
  14.          • Who wrote this?
  15.          • What else has Jim Browne written?
  16.          • Small print
  17.          • Conclusion
  18.          • Version History
  19. Introduction:
  20.  
  21.  I wrote this LAP while on my quest to port the Traceroute program to the Macintosh.  I 'grew up' on UNIX machines back in the mid-80's, and when I moved over to doing TCP/IP programming on the Mac, I really missed Traceroute... so here's the first part of it.
  22.  
  23. What does it do?:
  24.  
  25. What does this LAP do?  Well, it is (I hope) an exact duplicate of Apple's default Ethernet LAP with a few notable exceptions.  First, this LAP implementes loopback properly.  (Although it still doesn't do 127.0.0.1, but that can be added if enough people complain.)  Second, this LAP installs a Gestalt selector that allows application programs to perform Raw IP writes and filter all incoming IP packets.
  26.  
  27. Any known bugs?:
  28.  
  29. 1) Some problems with Powerbooks waking up from sleep mode.
  30. 2) Not recognizing some non-Apple Ethernet cards.
  31. 3) Not recognizing SCSI based Ethernet devices.
  32.  
  33. The Gestalt selector:
  34.  
  35. The Gestalt selector (JMBe), returns a pointer to the following structure (defined in RawIP.h):
  36.  
  37.  typedef struct {
  38.     short        version;                 // Version of interface
  39.     short        availFlags;              // What is available
  40.     RawWriteProcPtr        RawIPWrite;    // Raw IP Write routine address
  41.     RawIPFilterProcPtr    RawIPFilter; // Raw IP Filter routine address
  42.     short        useFilter;               // Non-zero if filter routine is to be called
  43.     Ptr             user1;                   // Passed to Filter routine
  44.     Ptr             user2;                   // Passed to Filter routine
  45.     ProcPtr        reserved1;
  46.     long        reserved2[10];
  47.     } RawIPGestaltStruct;
  48.  
  49. version is the current version of the LAP, in this case 1.
  50.  
  51. availFlags lists what features are available in the LAP.  The two currently defined flags are kHaveRIPFilter and kHaveRIPWrite.  I did this so I can distribute a version of the LAP source code that does not have IP filtering in it (more on this later).
  52.  
  53. RawIPWrite is the address of the routine to call inside the LAP to perform a raw IP write.
  54.  
  55. RawIPFilter is a location for you to stick the address of your RawIP filter routine.
  56.  
  57. useFilter tells the LAP whether or not it should call the RawIP filter routine.
  58.  
  59. user1 and user2 are two fields that are passed to the RawIP filter routine you install, use them as you see fit.
  60.  
  61. How to send Raw IP packets:
  62.  
  63. To send a RawIP packet onto the network, allocate a RawWriteParam structure.  Stick your A5 value in the userA5 field.  Fill out the wdsEntry to point to your IP packet in memory.  (Be sure to set the length field!).  Finally, you can place the address of a completion routine in the iop.ioCompletion field.  Then just call the RawWriteIP function, using the calling conventions typedef'd in RawWriteProcPtr.  It's that easy. The RawIPWrite function will return an error directly, or in the iop.ioResult field of the RawWriteParam structure.
  64.  
  65. Those of you who are familliar with the low level routines in MacTCP may recognize the RawWriteParam structure as something else in disguise.  Don't let your knowledge fool you! DO NOT try to use any of the reserved fields in the RawWriteParam structure, it won't neccessarily do what you would expect.
  66.  
  67. How to filter incoming IP packets:
  68.  
  69. Create a filter function in your application.  The filter function should be of the form typedef'd as RawIPFilterProcPtr.  The filter function should return true if the LAP should pass the IP packet onto MacTCP, otherwise the packet will be discarded and MacTCP will never see it.  The IPdata field points to the incoming IP packet, and the length field gives you its length.  You may modify the packet data if you wish.  However, changing the length of the packet will not work.  The filter function will only be called if the useFilter field in the Gestalt structure is non-zero.  Install your filter _before_ setting the userFilter field to a non-zero value.  Setting the useFilter field to zero will disable packet filtering.  I reccomend your application patch ExitToShell to zero the useFilter field, just in case.
  70.  
  71. So where's Traceroute?:
  72.  
  73. MacTraceroute should have come with this LAP and Release Notes file.  If not, you can get it from ftp.jbrowne.com in the Projects directory, or from your local INFO-MAC mirror.
  74.  
  75. What about source code?:
  76.  
  77. I can give out the source code to 90% of the LAP.  The code in there that lets me do IP packet filtering, however, is private.  Check ftp.jbrowne.com for the archive.  If it isn't there, drop me a line at traceroute@jbrowne.com.
  78.  
  79. Who wrote this?:
  80.  
  81. The Traceroute Ethernet LAP  was written by Jim Browne (jbrowne@jbrowne.com).  Jim is a graduate of  the University of Illinois - Chambana.  Jim currently works for himself at a Sunnyvale, California based networking concern.  Jim likes all things related to Led Zeppelin and frisbee (which is a brand name and registered trademark of the wham-o mfg. company).  Jim doesn't mind getting bug reports and wish list suggestions via email, so long as they contain "Traceroute" in their subject so Eudora can filter them to the proper mailbox.  Beginning with the writing of this file, Jim apparently likes referring to himself in
  82. the third person.
  83.  
  84. What else has Jim Browne written?:
  85.  
  86. DNSLib: A library that makes working with MacTCP's DNR much easier by providing application-time callbacks for DNR responses, queueing of DNR requests, and handling of N concurrent DNR questions.  MacTraceroute and MacFSP use this library.  Note: This has nothing to do with ASLM, SOM, etc.
  87.         
  88. MacFSP: A Macintosh client for the FSP protocol.
  89.  
  90. TuboUDP: A library that makes writing UDP code under MacTCP much easier.
  91.  
  92. During my short stint at Sonic Systems, Inc., I wrote the SonicPPP client, co-designed the interface for the manager of Sonic's QuickStream with Chris Russo (5 diamonds, MacWeek 1/29/96), wrote most of Sonic's Macintosh based PPP server, and helped debug the QuickStream.
  93.  
  94. In a former life, I worked on two little known programs: NCSA Telnet and NCSA Mosaic… you probably haven't heard of either of them.
  95.  
  96. Small print:
  97.  
  98. There is no warranty on this software whatsoever.  It has worked without problems for me for quite some time.  However, if it crashes your machine or causes you to lose data, I cannot be held responsible.  I am trying to make it flawless, but I can't state that it is 100% reliable.
  99.  
  100. Conclusion:
  101.  
  102. I've had the TR Ethernet LAP (1.0) running on many different Macintoshes for more than a year.  I've had no problems with it.  This does not, of course, guarantee that it is bug free.  Please report any bugs you find to traceroute@jbrowne.com.  I'm very open to suggestions.  I decided at the beginning to make this interface open so other people could use it.  I figure if people have to run a separate LAP to get this functionality, they don't want to have to swtich between N different LAPs for N different packet filtering applications.
  103.  
  104. If you would like to modify your SLIP or PPP lap to support this interface, please let me know and I will give you any help I possibly can.  I'd like my traceroute program to work over SLIP and PPP.
  105.  
  106. Enjoy the LAP, and WRITE FREE SOFTWARE for it. ;)
  107.  
  108. Jim Browne
  109. jbrowne@jbrowne.com
  110.  
  111. PS: You see, Klaus, I really do release my code... eventually!
  112.  
  113. Version History:
  114.  
  115. 1.2 March 10, 1996:
  116.  
  117. Fixed the LAP to be classless with respect to determining broadcast addresses.  Should fix the problem experienced by people on subnetted Class C nets (i.e. subnets 255.255.255.x where x is 192, 224, 240, 248, or 252).
  118.  
  119. 1.1 June 30, 1995:
  120.  
  121. Updated my email address.
  122. Ported to Metrowerks CodeWarrior.
  123. Shortened name LAP gives MacTCP for control panel window so slot number is displayed.
  124. Improved RawIP.h's compatability with Universal Headers.
  125.  
  126. 1.0 July 23, 1994:
  127.  
  128. Initial release
  129.  
  130.  
  131.